﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ListContact.ascx.cs" Inherits="Pantry.Web.Users.Controls.ListContact" %>
<%@ Register TagPrefix="CC1" Namespace="SiteUtils" Assembly="CollectionPager" %>
<asp:UpdatePanel ID="UpdatePanelContact" runat="server">
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="CollectionPager1" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="CheckBoxIsActive" EventName="CheckedChanged" />
            <asp:AsyncPostBackTrigger ControlID="ButtonSearch" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="ButtonNone" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="ButtonCreate" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="ButtonClear" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="ButtonEdit" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="ButtonSortByName" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="ButtonSortByMobile" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="ButtonSortByEmail" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="ButtonSortByStatus" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="ButtonSortByType" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="ButtonSelect" EventName="Click" />
            <%--<asp:PostBackTrigger ControlID="ButtonSelect"/>--%>
        </Triggers>
        <ContentTemplate>
            <%--<div id="list_contact" class="g_12">--%>
                <%--<div class="widget_header wwOptions">
                    <h4 class="widget_header_title wwIcon i_16_data">
                        List Contacts</h4>
                </div>--%>
                <div class="widget_contents noPadding">
                    <div class="dataTables_wrapper">
                        <div class="dtTop">
                            <div class="dtShowPer">
                                <asp:CheckBox ID="CheckBoxIsActive" runat="server" CssClass="simple_form my_checkbox"
                                    Text="Include in-active contact?" AutoPostBack="true" OnCheckedChanged="CheckBoxIsActiveCheckedChanged" />
                            </div>
                            <div class="dtFilter">
                                <div class="dataTables_filter">
                                    <div style="width: auto; margin-left: 15px; float: left;">
                                        First Name:
                                        <asp:TextBox ID="TextBoxFirstName" runat="server" CssClass="simple_field" Width="150px" />
                                    </div>
                                    <div style="width: auto; margin-left: 25px; float: right;">
                                        Surname:
                                        <asp:TextBox ID="TextBoxSurname" runat="server" CssClass="simple_field" Width="150px"
                                            AutoPostBack="True" />
                                    </div>
                                    <div id="control_buttons" style="margin-left: 15px">
                                        <asp:Button ID="ButtonSearch" runat="server" CssClass="simple_buttons" Text="Search Contact"
                                            OnClick="ButtonSearchClick" />
                                        <asp:Button ID="ButtonClear" runat="server" CssClass="simple_buttons my_button" Text="Clear"
                                            OnClick="ButtonClearClick" />
                                        <asp:Button ID="ButtonNone" runat="server" CssClass="simple_buttons my_button" Text="None"
                                            OnClick="ButtonNoneClick" />
                                        <asp:Button ID="ButtonCreate" runat="server" CssClass="simple_buttons my_button"
                                            Text="Create" OnClick="ButtonCreateClick" />
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="dtTables widget_contents noPadding">
                            <table id="DataTables_Table_0" class="tables">
                                <thead>
                                    <tr id="head_table">
                                        <th>
                                        </th>
                                        <th class="sorting">
                                            <asp:LinkButton ID="ButtonSortByName" runat="server" OnClick="ButtonSortByNameClick">Contact Name</asp:LinkButton>
                                        </th>
                                        <th class="sorting">
                                            <asp:LinkButton ID="ButtonSortByMobile" runat="server" OnClick="ButtonSortByMobileClick">Mobile Phone</asp:LinkButton>
                                        </th>
                                        <th class="sorting">
                                            <asp:LinkButton ID="ButtonSortByEmail" runat="server" OnClick="ButtonSortByEmailClick">Email</asp:LinkButton>
                                        </th>
                                        <th class="sorting">
                                            <asp:LinkButton ID="ButtonSortByType" runat="server" OnClick="ButtonSortByContactTypeClick">Contact Type</asp:LinkButton>
                                        </th>
                                        <th class="sorting">
                                            <asp:LinkButton ID="ButtonSortByStatus" runat="server" OnClick="ButtonSortByStatusClick">Is Active?</asp:LinkButton>
                                        </th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <asp:Repeater ID="RepeaterContact" runat="server">
                                        <ItemTemplate>
                                            <tr>
                                                <td>
                                                    <input type="radio" id="radio" name="RadioContactId" value="<%#Eval("ContactId") %>$<%#Eval("FullName") %>"
                                                        class="simple_form" />
                                                </td>
                                                <td>
                                                    <%#Eval("FullName")%>
                                                </td>
                                                <td>
                                                    <%#Eval("MobilePhone")%>
                                                </td>
                                                <td>
                                                    <%#Eval("Email")%>
                                                </td>
                                                <td>
                                                    <%#Eval("ContactType") %>
                                                </td>
                                                <td>
                                                    <%#Eval("IsActive") %>
                                                </td>
                                            </tr>
                                        </ItemTemplate>
                                    </asp:Repeater>
                                </tbody>
                            </table>
                        </div>
                        <div class="dtBottom">
                            <div class="dtInfo">
                                <div id="control_buttons1">
                                    <asp:Button ID="ButtonSelect" runat="server" Text="Select" CssClass="simple_buttons my_button"
                                        OnClick="ButtonSelectClick" />
                                    <asp:Button ID="ButtonEdit" runat="server" Text="Edit" CssClass="simple_buttons my_button"
                                        OnClick="ButtonEditClick" />
                                    <asp:Button ID="ButtonClose" runat="server" Text="Close" CssClass="simple_buttons my_button" OnClientClick="CloseContactPopup()" />
                                </div>
                            </div>
                            <div class="dtPagination">
                                <CC1:CollectionPager ID="CollectionPager1" runat="server" BackText="Back" FirstText="First"
                                    ShowLabel="True" ShowFirstLast="False" NextText="Next" ResultsLocation="None"
                                    PageNumbersSeparator=" " HideOnSinglePage="False" PagingMode="PostBack">
                                </CC1:CollectionPager>
                            </div>
                        </div>
                    </div>
                </div>
            <%--</div>--%>
        </ContentTemplate>
    </asp:UpdatePanel>